package no.sachmuld.methodcombination.examples.reflection.roles.employee.lib;

import no.sachmuld.methodcombination.api.MethodInvocation;
import no.sachmuld.methodcombination.api.reflection.Default;
import no.sachmuld.methodcombination.examples.reflection.roles.MethodCombinationWithRoleSupport;
import no.sachmuld.methodcombination.examples.reflection.roles.employee.api.Employee;
import no.sachmuld.methodcombination.examples.reflection.roles.employee.api.EmployeeRole;


/**
 *
 */
public class EmployeeImpl extends MethodCombinationWithRoleSupport<EmployeeRole, EmployeeBehaviour> implements Employee {

    public EmployeeImpl(final int salary) {
        with(new EmployeeBehaviour() {
            @Override
            public int salary(MethodInvocation<Integer> methodInvocation) {
                return salary;
            }
        });
    }

    @Override
    final public int salary() {
        return new Default<Integer>().build(EmployeeBehaviour.class, EmployeeImpl.class, "salary").execute(this, chain());
    }

}
